﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ZeroTouchUI
{
    /// <summary>
    /// Interaction logic for RejectedGesture.xaml
    /// </summary>
    public partial class RejectedGesture : Window
    {
        public RejectedGesture()
        {
            InitializeComponent();
            this.rejectedText.Text = "An unknown error has caused this gesture to be rejected. Please try again.";
        }

        public RejectedGesture(string text)
        {
            InitializeComponent();
            this.rejectedText.Text = text;
        }

        private void close_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void edit_Click(object sender, RoutedEventArgs e)
        {
            foreach (Window w in Application.Current.Windows)
            {
                if (w.GetType().ToString().Contains("Edit"))
                {
                    w.Activate();
                }
                else if (w.GetType().ToString().Contains("AddGesture") ||
                         w.GetType().ToString().Contains("GestureRecorder"))
                {
                    w.Close();
                }
            }

            this.Close();
        }
    }
}
